import 'package:flutter/material.dart';

import '../../constant/color_constant.dart';
import '../../ecycommon/EcyCommonWidgets.dart';
import '../../ecycommon/EcyWebViewPage.dart';

class EcyPrivacyPolicyPage extends EcyCommonBaseWidget {
  late _EcyPrivacyPolicyPageState state;

  String? url;
  String? title;

  EcyPrivacyPolicyPage(this.url, this.title);

  @override
  State<EcyCommonBaseWidget> createState() {
    state = _EcyPrivacyPolicyPageState(this.url, this.title);
    return state;
  }

}

class _EcyPrivacyPolicyPageState extends EcyCommonBaseWidgetState {
  late EcyCommonBaseWidget controller;

  late String? _url;
  late String? _title;

  _EcyPrivacyPolicyPageState(this._url, this._title);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      backgroundColor: ColorConstant.White,
      appBar: AppBar(
        backgroundColor: ColorConstant.White,
        centerTitle: true,
        title: Text(_title ?? "个人信息保护政策", style: const TextStyle(
            fontFamily: "PingFang SC",
            fontWeight: FontWeight.w700,
            fontSize: 18,
            color: Color(0xFF262626)
        ),),
      ),
      body: Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height - 150,
        // color: Colors.black,
        decoration: const BoxDecoration(color: Color(0xFFF5F5F5)),
        child: EcyWebViewPage(_url ?? "https://www.goodsqi.com/agreement/agreement.html", _title ?? "个人信息保护政策"),
      ),
    );
  }

}